<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
    <style>
        .obj1{
            color: deeppink;
        }
        .obj2{
            font-size: 20px;
            border: 2px solid black;
        }
        .obj3{
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
<div id="app">
<!--    1.绑定字符串-->
    <div :class="str">绑定字符串</div>
<!--    2.绑定对象-->
    <div :class="obj">绑定对象1</div>
    <div :class="{obj1:false,obj2:true,obj3:true}">绑定对象2</div>
    <!--    3.绑定数组-->
    <div :class="arr">绑定数组1</div>
    <div :class="['obj1','obj2','obj3']">绑定数组2</div>
</div>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: '#app',
        data() {
            return {
                str:'obj1',
                obj:{
                    obj1:true,
                    obj2:true,
                    obj3:false
                },
                arr:['obj1','obj2','obj3']
            }
        }
    })
</script>
</body>
</html>